import React from 'react';
import { WeaLocaleProvider, WeaSearchGroup } from 'ecCom';
import EType from './base/EType';
import ETitle from './base/ETitle';
import DataSourceTable from "./base/DataSourceTable";

const getLabel = WeaLocaleProvider.getLabel;

// 时间轴元素
 class Content_timeLine extends React.Component {

     state = {
         datas: this.props.datas || [],
 }

    constructor(props) {
        super(props);
    }

    render() {
        const { hpid, eid, ebaseid, eShareLevel, synergyParams, eBaseName, eTitle, eCustom = {} } = this.props;
        let __DataSourceTable = <div></div>;
        if (eShareLevel == '2') {
            __DataSourceTable = <DataSourceTable ecId={`${this && this.props && this.props.ecId || ''}_DataSourceTable@l1vzui`} ref="dataSourceTable" hpid={hpid} eid={eid} ebaseid={ebaseid} {...this.props.eTabs}  synergyParams={synergyParams}/>;
        }
        return (
            <div>
            <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@zua98i`} title={getLabel(81711, '基本信息')} needTigger={true} showGroup={true}>
            <EType ecId={`${this && this.props && this.props.ecId || ''}_EType@omzeo6`} ref="eType" value={eBaseName} />
        {eShareLevel == '2' ? <ETitle ecId={`${this && this.props && this.props.ecId || ''}_ETitle@oqtaiz`} ref="eTitle" eid={eid} value={eTitle}   {...this.props}/> : ''}
        </WeaSearchGroup>
            {  __DataSourceTable}
        </div>
        );
    }

 getSaveValues() {
        return {
            eContentTitle: this.refs['eTitle'] ? this.refs['eTitle'].getSaveValues() : this.props.eTitle,
            eContentTabWidth: { tabwidth: this.props.etabwidth, methodvalue: this.props.methodvalue },
            eContentIsAlwaysShow: this.props.isAlwaysShow,
            eContenteTabStyle: { tabstyle: this.props.tabstyle, tabvalue: this.props.tabvalue, tabname: this.props.tabname },
            eTabs: this.refs['dataSourceTable'] ? this.refs['dataSourceTable'].getSaveValues() : {},
        };
    }
}


export default Content_timeLine

